//
//  LandMarkList.swift
//  SwiftUIDemo
//
//  Created by Kael on 2019/11/5.
//  Copyright © 2019 Kael. All rights reserved.
//

import SwiftUI

struct LandMarkList: View {
    
    @State var showFavoritesOnly = true

    var body: some View {
        NavigationView{
            List{
                Toggle(isOn: $showFavoritesOnly) {
                    Text("Favorites only")
                }
                ForEach (0 ..< 15) { item in
                    NavigationLink(destination: self.didselectedCell(item: item)) {
                        KLLandMarkRow()
                    }
                }
            }
            .navigationBarTitle(Text("我是一名程序媛"))
        }
//        .edgesIgnoringSafeArea(.top)
        
    }
    
    func didselectedCell(item : Int) -> ImageView {
        print("kael lllal \(item)")
        
        return ImageView()
    }
}

struct LandMarkList_Previews: PreviewProvider {
    static var previews: some View {
        ForEach(["iPhone 8"], id: \.self) { deviceName in
            LandMarkList()
                .previewDevice(PreviewDevice(rawValue: deviceName))
        }
    }
}
